/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.own.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 药材赋码信息Entity
 * @author F
 * @version 2019-09-27
 */
@Table(name="own_medicine_assignment", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一ID", isPK=true),
		@Column(name="own_medicine_receipt_information_id", attrName="ownMedicineReceiptInformationId", label="药材收获信息ID", isQuery=false),
		@Column(name="own_medicine_subcontracting_id", attrName="ownMedicineSubcontractingId", label="药材分包信息ID", isQuery=false),
		@Column(name="serial_number", attrName="serialNumber", label="序列号"),
		@Column(name="medicine_batch_id", attrName="medicineBatchId", label="药材批次号"),
		@Column(name="source_code", attrName="sourceCode", label="商品编码"),
		@Column(name="variety_name", attrName="varietyName", label="品名", queryType=QueryType.LIKE),
		@Column(name="area_code", attrName="areaCode", label="区域编码"),
		@Column(name="spec", attrName="spec", label="规格"),
		@Column(name="weight", attrName="weight", label="重量", comment="重量(g)"),
		@Column(name="time", attrName="time", label="赋码时间"),
		@Column(name="bm_trace_code", attrName="bmTraceCode", label="追溯码"),
		@Column(name="bm_batch_code", attrName="bmBatchCode", label="药材批次码"),
		@Column(name="out_status", attrName="outStatus", label="出库状态"),
		@Column(name="create_company", attrName="createCompany", label="所属企业标识", isUpdate=false, isQuery=false),
		@Column(name ="uuid", attrName ="uuid",label = "操作标识符"),
		@Column(name="txid", attrName ="txid",label = "返回的txid"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class OwnMedicineAssignment extends DataEntity<OwnMedicineAssignment> {
	
	private static final long serialVersionUID = 1L;
	private String ownMedicineReceiptInformationId;		// 药材收获信息ID
	private String ownMedicineSubcontractingId;		// 药材分包信息ID
	private String serialNumber; //序列号
	private String medicineBatchId;		// 药材批次号
	private String sourceCode;		// 商品编码
	private String varietyName;		// 品名
	private String areaCode;		// 区域编码
	private String spec;		// 规格
	private Double weight;		// 重量(g)
	private Date time;		// 赋码时间
	private String bmTraceCode;		// 追溯码
	private String bmBatchCode;		// 药材批次码
	private String outStatus; //出库状态
	private String createCompany;		// 所属企业标识
	private String uuid;		//索引本次操作的上下本标识
	private String txid;

	public String getTxid() {
		return txid;
	}

	public void setTxid(String txid) {
		this.txid = txid;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public OwnMedicineAssignment() {
		this(null);
	}

	public OwnMedicineAssignment(String id){
		super(id);
	}

	@NotBlank(message="药材收获信息ID不能为空")
	@Length(min=0, max=64, message="药材收获信息ID长度不能超过 64 个字符")
	public String getOwnMedicineReceiptInformationId() {
		return ownMedicineReceiptInformationId;
	}

	public void setOwnMedicineReceiptInformationId(String ownMedicineReceiptInformationId) {
		this.ownMedicineReceiptInformationId = ownMedicineReceiptInformationId;
	}

	@NotBlank(message="药材分包信息ID不能为空")
	@Length(min=0, max=64, message="药材分包信息ID长度不能超过 64 个字符")
	public String getOwnMedicineSubcontractingId() {
		return ownMedicineSubcontractingId;
	}

	public void setOwnMedicineSubcontractingId(String ownMedicineSubcontractingId) {
		this.ownMedicineSubcontractingId = ownMedicineSubcontractingId;
	}

	@NotBlank(message="序列号不能为空")
	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	@NotBlank(message="药材批次号不能为空")
	@Length(min=0, max=25, message="药材批次号长度不能超过 25 个字符")
	public String getMedicineBatchId() {
		return medicineBatchId;
	}

	public void setMedicineBatchId(String medicineBatchId) {
		this.medicineBatchId = medicineBatchId;
	}

	@NotBlank(message="商品编码不能为空")
	@Length(min=0, max=50, message="商品编码长度不能超过 50 个字符")
	public String getSourceCode() {
		return sourceCode;
	}

	public void setSourceCode(String sourceCode) {
		this.sourceCode = sourceCode;
	}

	@NotBlank(message="品名不能为空")
	@Length(min=0, max=50, message="品名长度不能超过 50 个字符")
	public String getVarietyName() {
		return varietyName;
	}

	public void setVarietyName(String varietyName) {
		this.varietyName = varietyName;
	}

	@NotBlank(message="区域编码不能为空")
	@Length(min=0, max=6, message="区域编码长度不能超过 6 个字符")
	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	@NotBlank(message="规格不能为空")
	@Length(min=0, max=10, message="规格长度不能超过 10 个字符")
	public String getSpec() {
		return spec;
	}

	public void setSpec(String spec) {
		this.spec = spec;
	}

	@NotNull(message="重量不能为空")
	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	@NotNull(message="赋码时间不能为空")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	@Length(min=0, max=50, message="追溯码长度不能超过 50 个字符")
	public String getBmTraceCode() {
		return bmTraceCode;
	}

	public void setBmTraceCode(String bmTraceCode) {
		this.bmTraceCode = bmTraceCode;
	}

	@NotBlank(message="药材批次码不能为空")
	@Length(min=0, max=50, message="药材批次码长度不能超过 50 个字符")
	public String getBmBatchCode() {
		return bmBatchCode;
	}

	public void setBmBatchCode(String bmBatchCode) {
		this.bmBatchCode = bmBatchCode;
	}

	public String getOutStatus() {
		return outStatus;
	}

	public void setOutStatus(String outStatus) {
		this.outStatus = outStatus;
	}

	@Length(min=0, max=64, message="所属企业标识长度不能超过 64 个字符")
	public String getCreateCompany() {
		return createCompany;
	}

	public void setCreateCompany(String createCompany) {
		this.createCompany = createCompany;
	}
	
}